﻿using System;
#if DEBUG
using System.Diagnostics;
#endif // #if DEBUG
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace FRL.DebtChased.Silverlight.Library
{

	/// <summary>
	/// Declaration of LibrarySession class
	/// This class must be constructed in any plugin that uses this library
	/// </summary>
	public class LibrarySession
	{

		/////////////////////////////////////////////////////////////
		// Attributes

		private static LibrarySession m_singleton = null;
		public static LibrarySession Singleton
		{
			get { return m_singleton; }
		}

		private IDebtChasedMainPlugInWindow m_IMainPage;
		public IDebtChasedMainPlugInWindow IMainPage
		{
			get { return m_IMainPage; }
		}

		public static bool IsValid
		{
			get {
				return(
					(m_singleton != null)
					&&
					(m_singleton.m_IMainPage != null) 
				);
			}
		}

		/////////////////////////////////////////////////////////////
		// Construction

		public LibrarySession(IDebtChasedMainPlugInWindow IMainPage)
		{

			// Initialize member variables
			m_IMainPage = IMainPage;

			// Construct singleton object
#if DEBUG
			Debug.Assert(m_singleton == null);
#endif // #if DEBUG
			m_singleton = this;

		}

	}

	/// <summary>
	/// Declaration of IDebtChasedMainPlugInWindow interface
	/// </summary>
	public interface IDebtChasedMainPlugInWindow
	{

		/////////////////////////////////////////////////////////////
		// Operations

		void ShowHourglass(bool bTrue);

		void WebsiteMenuClicked(DebtChasedWebsiteMenuCtrl.eMenuItem menuItemId);

		void ContactPointButtonClick( PointActiveButton button, int iContactId, Guid contactPointId );

	}

}
